﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="zxx" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <title>Ayurvedic - Medical Template</title>

    <link rel="shortcut icon" type="image/x-icon" href="assets/images/cropped-favicon-32x32.png"/>

    <link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>

    <link href="assets/css/style.css" rel="stylesheet" type="text/css"/>

    <link href="assets/css/plugin.css" rel="stylesheet" type="text/css"/>

    <link href="assets/css/dashboard.css" rel="stylesheet" type="text/css"/>

    <link href="assets/fonts/flaticon.css" rel="stylesheet" type="text/css"/>

    <link href="assets/css/icons.css" rel="stylesheet" type="text/css"/>

    <link rel="stylesheet" href="assets/fonts/line-icons.css" type="text/css"/>
    <link rel="stylesheet" href="common/font-awesome/css/font-awesome.min.css">
</head>
<body>

<div id="preloader">
    <div id="status"></div>
</div>


<div th:replace="common/common-bar::#header"></div>

<div id="dashboard">
    <div class="container">
        <div class="dashboard-main">
            <div class="row">
                <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12">
                    <div th:replace="common/common-bar::#dashboard-sidebar(cur='medicine')"></div>
                </div>
                <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12">
                    <div class="dashboard-content">
                        <div class="dashboard-form mb-4">
                            <div class="row">

                                <div class="col-lg-12 col-md-12 col-xs-12 padding-right-30">
                                    <div class="dashboard-list">
                                        <h4 class="gray">药品信息</h4>
                                        <div class="dashboard-list-static">
                                            <div class="edit-profile-photo">
                                                <img id="img-preview" th:if="${medicine.imgPath != null}" th:src="${medicine.imgPath}" alt=""/>
                                                <img id="img-preview" th:if="${medicine.imgPath == null}" src="https://img0.baidu.com/it/u=4191653269,3254386604&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500" alt=""/>
                                                <div class="change-photo-btn">
                                                    <div class="photoUpload">
                                                        <span><i class="fa fa-upload"></i> 点击上传</span>
                                                        <input id="img-file" type="file" class="upload" onchange="uploadPhoto()"/>
                                                        <input style="display: none" id="img" th:value="${medicine.imgPath}" type="text"/>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="my-profile">
                                                <div class="form-group">
                                                    <label>药品名称</label>
                                                    <input id="medicineName" th:value="${medicine.medicineName}" type="text"/>
                                                    <input style="display: none" id="id" th:value="${medicine.id}" type="text"/>
                                                </div>

                                                <div class="form-group">
                                                    <label>关键字搜索</label>
                                                    <input id="keyword" type="text" th:value="${medicine.keyword}"/>
                                                </div>

                                                <div class="form-group">
                                                    <label>品牌</label>
                                                    <input id="medicineBrand" type="text" th:value="${medicine.medicineBrand}"/>
                                                </div>

                                                <div class="form-group">
                                                    <label>价格</label>
                                                    <input id="medicinePrice" type="text" th:value="${medicine.medicinePrice}"/>
                                                </div>

                                                <div class="form-group">
                                                    <label>主要的功效</label>
                                                    <textarea id="medicineEffect" style="height: 100px" th:text="${medicine.medicineEffect}"></textarea>
                                                </div>

                                                <div class="form-group">
                                                    <label>相互作用</label>
                                                    <textarea id="interaction" style="height: 100px" th:text="${medicine.interaction}"></textarea>
                                                </div>

                                                <div class="form-group">
                                                    <label>禁忌</label>
                                                    <textarea id="taboo" style="height: 100px" th:text="${medicine.taboo}"></textarea>
                                                </div>

                                                <div class="form-group">
                                                    <label>用法用量</label>
                                                    <textarea id="usAge" style="height: 100px" th:text="${medicine.usAge}"></textarea>
                                                </div>

                                                <div th:if="${medicine.createTime != null}" class="form-group">
                                                    <label>关联疾病</label><br>
                                                    <span th:if="${illness.illnessMedicine != null}" th:title="${illness.illnessSymptom}" style="margin: 5px" th:each="illness: ${illnesses}">
                                                        <input th:value="${illness.id}" type="checkbox" name="illness" checked th:onchange="deleteIllnessMedicine([[${illness.illnessMedicine.id}]])">
                                                        [[${illness.illnessName}]]
                                                    </span>
                                                    <span th:if="${illness.illnessMedicine == null}" th:title="${illness.illnessSymptom}" style="margin: 5px" th:each="illness: ${illnesses}">
                                                        <input th:value="${illness.id}" type="checkbox" name="illness" th:onchange="saveIllnessMedicine([[${illness.id}]], [[${medicine.id}]])">
                                                        [[${illness.illnessName}]]
                                                    </span>
                                                </div>

                                                <div class="form-group">
                                                    <label>药物类型</label>
                                                    <select id="medicineType" class="niceSelect">
                                                        <option th:if="${medicine.medicineType == 1}" value="1">西药</option>
                                                        <option th:if="${medicine.medicineType == 2}" value="2">中药</option>
                                                        <option th:if="${medicine.medicineType == 3}" value="3">中成药</option>
                                                        <option value="1">西药</option>
                                                        <option value="2">中药</option>
                                                        <option value="3">中成药</option>
                                                    </select>
                                                </div>

                                                <div th:if="${medicine.createTime != null}" class="form-group">
                                                    <label>创建时间</label>
                                                    <input style="background: #ecf0f1" disabled type="text" th:value="${#dates.format(medicine.createTime, 'yyyy-MM-dd HH:mm:ss')}"/>
                                                </div>

                                                <div th:if="${medicine.updateTime != null}" class="form-group">
                                                    <label>修改时间</label>
                                                    <input style="background: #ecf0f1" disabled type="text" th:value="${#dates.format(medicine.updateTime, 'yyyy-MM-dd HH:mm:ss')}"/>
                                                </div>

                                            </div>
                                            <div>
                                                <button class="btn btn-na" onclick="saveMedicine()">保存</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>

<div th:replace="common/common-bar::#back"></div>

<div th:replace="common/common-bar::#footer"></div>

<div th:replace="common/common-bar::#search"></div>

<div th:replace="common/common-bar::#back-to-top"></div>

<script src="assets/js/jquery-3.5.1.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/plugin.js"></script>
<script src="assets/js/main.js"></script>
<script src="assets/js/custom-nav.js"></script>
<script src="assets/js/jpanelmenu.min.js"></script>
<script src="assets/js/dashboard-custom.js"></script>
<script src="common/utils/reg.js"></script>
<script src="common/layer/layer.js"></script>
<script src="common/custom.js"></script>
</body>
</html>
